package com.kgc.service.impl;

import com.kgc.entity.ChoiceQuestion;
import com.kgc.dao.ChoiceQuestionDao;
import com.kgc.service.ChoiceQuestionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (ChoiceQuestion)表服务实现类
 *
 * @author unicorn
 * @since 2020-05-21 14:05:07
 */
@Service("choiceQuestionService")
public class ChoiceQuestionServiceImpl implements ChoiceQuestionService {
    @Resource
    private ChoiceQuestionDao choiceQuestionDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public ChoiceQuestion queryById(Integer id) {
        return this.choiceQuestionDao.queryById(id);
    }

    @Override
    public List<ChoiceQuestion> queryChoiceQuestion() {
        return this.choiceQuestionDao.queryChoiceQuestion();
    }


    /**
     * 新增数据
     *
     * @param choiceQuestion 实例对象
     * @return 实例对象
     */
    @Override
    public Integer insert(ChoiceQuestion choiceQuestion) {
        return this.choiceQuestionDao.insert(choiceQuestion);
    }

    /**
     * 修改数据
     *
     * @param choiceQuestion 实例对象
     * @return 实例对象
     */
    @Override
    public Integer update(ChoiceQuestion choiceQuestion) {
       return this.choiceQuestionDao.update(choiceQuestion);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public Integer deleteById(Integer id) {
      return this.choiceQuestionDao.deleteById(id);
    }
}